﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Text;
using System.Windows.Forms;

namespace Smith.ImageConverter
{
    public partial class About : Form
    {
        public About()
        {
            InitializeComponent();
            this.Icon = Properties.Resources.About;
            this.BackgroundImage = GetBackgroundImage(ClientRectangle);
            LVersionInfo.Text = "Version: " + Application.ProductVersion;
        }

        private Bitmap GetBackgroundImage(Rectangle rect)
        {
            Bitmap bitmap = new Bitmap(rect.Width, rect.Height);
            Graphics graphic = Graphics.FromImage(bitmap);
            LinearGradientBrush lbrush = new LinearGradientBrush(rect, Color.White, Color.AliceBlue, LinearGradientMode.Vertical);
            Rectangle brect = new Rectangle(0, rect.Height - 48, rect.Width, 48);
            LinearGradientBrush bbrush = new LinearGradientBrush(brect, Color.LightCyan, Color.LightBlue, LinearGradientMode.Vertical);
            SolidBrush sbrush = new SolidBrush(Color.FromArgb(60, Color.White));
            graphic.FillRectangle(lbrush, rect);
            graphic.FillRectangle(bbrush, brect);
            graphic.FillRectangle(sbrush, brect.Left, brect.Top, brect.Width, brect.Height / 2);
            sbrush.Dispose();
            lbrush.Dispose();
            bbrush.Dispose();
            graphic.Dispose();
            return bitmap;
        }

        private void OpenWebsiteURL(object sender, EventArgs e)
        {
            try
            {
                System.Diagnostics.Process.Start(Properties.Resources.WebsiteURL);
            }
            catch (Exception) { }
            
        }

        private void OpenBlogURL(object sender, EventArgs e)
        {
            try
            {
                System.Diagnostics.Process.Start(Properties.Resources.BlogURL);
            }
            catch (Exception) { }
            
        }

        private void OpenEmailURL(object sender, EventArgs e)
        {
            try
            {
                System.Diagnostics.Process.Start(Properties.Resources.EmailURL);
            }
            catch (Exception) { }            
        }
 
    }
}
